Page({
  data: {
    isLoading:true,
    types:[
      {value: '全部(147)', enable: true},
      {value: '带图(6)', enable: true},
      {value: '好评(145)', enable: true},
      {value: '中评(2)', enable: true},
      {value: '差评(0)', enable: false}
    ],
    isPopped:false,
    isPoppedVideo:false,
    thumb:'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08b.png',
    video:'https://cdn-we-retail.ym.tencent.com/tsr/goods/comment-video.mp4',
    currentTab:0,
  },
  onLoad(option) {
    setTimeout(()=>{
      this.setData({isLoading:false});
    },400);
  },
  popImage(e) {
    this.setData({isPopped:true});
  },
  popVideo(e) {
    this.setData({isPopped:true});
    this.setData({isPoppedVideo:true});
    var videoplay = wx.createVideoContext('videoPlayer');
    videoplay.play();
  },
  hidePop(e) {
    this.setData({isPopped:false});
    if(this.data.isPoppedVideo){
      var videoplay = wx.createVideoContext('videoPlayer');
      videoplay.stop();
    }
    this.setData({isPoppedVideo:false});
  },
  onTab(e) {
    //console.log('onTab:',e.detail.current);
    this.setData({isLoading:true});
    this.setData({currentTab:e.detail.current});
    setTimeout(()=>{
      this.setData({isLoading:false});
    },600);
  },
  onRateChange(e) {
  }
})